package org.liulinlin.sejw.db;

import java.sql.*;

public class FormEmployee {
	private String id;
	private String pwd;
	private String name;
	
	public FormEmployee() {
		
	}
	public FormEmployee(String id) {
		DBConnectionManager connMgr = DBConnectionManager.getInstance();
		Connection con = connMgr.getConnection("shipping_export");
		if (con == null) {
			System.out.println("FormEmployee不能获得数据库连接");
			return;
		}
		
		try {
			Statement stmt = con.createStatement();
			ResultSet rs = stmt.executeQuery("select * from FormEmployee where FE_ID = '" + id + "'");
		
			rs.next();
			this.id = id;
			pwd = rs.getString("FE_Pwd");
			name = rs.getString("FE_Name");
			
			stmt.close();
			rs.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		connMgr.freeConnection("shipping_export", con);
		connMgr.release();
	}
	
	public void setId(String id) {
		this.id = id;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getId() {
		return id;
	}
	public String getPwd() {
		return pwd;
	}
	public String getName() {
		return name;
	}
}
